package com.groupbuying.store.dto.forManage;

import com.groupbuying.store.domain.StoreCapitalVirtualAccountDetailDO;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 小程序账户流水
 */
public class StoreCapitalVirtualAccountDetaiDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 流水号
     */
    private String billNo;

    /**
     * 商户号
     */
    private String storeName;



    /**
     * 操作金额
     */
    private String operAmount;

    /**
     * 操作类型
     */
    private String operType;

    /**
     * 描述
     */
    private String description;
    /**
     * 余额
     */
    private BigDecimal balance;
    /**
     * 操作类型
     */
    private String businessType;
    /**
     * 创建时间
     */
    private String createTime;

    public StoreCapitalVirtualAccountDetaiDTO(StoreCapitalVirtualAccountDetailDO detailDO) {
        setBillNo(detailDO.getBillno());
        setStoreName(detailDO.getStoreno());
        setOperType(detailDO.getInorout());
        setOperAmount(detailDO.getOperamount().toString());
        setDescription(detailDO.getDescription());
        setBalance(detailDO.getBalance());
        setBusinessType(detailDO.getBusinesstype());
        setCreateTime(detailDO.getCreateopetime());

    }

    public String getBillNo() {
        return billNo;
    }

    public void setBillNo(String billNo) {
        this.billNo = billNo;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getBusinessType() {
        return businessType;
    }

    public void setBusinessType(String businessType) {
        if(businessType.equals("1000")){
            businessType="优惠买单订单退款";
        }else if(businessType.equals("2000")){
            businessType="商家提现";
        }else if(businessType.equals("3000")){
            businessType="优惠买单订单分账";
        }else if(businessType.equals("4000")){
            businessType="够样优店订单分账";
        }else if(businessType.equals("5000")){
            businessType="够样优店订单退款";
        }else {
            businessType="暂无订单分类";
        }
        this.businessType = businessType;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getOperAmount() {
        return operAmount;
    }

    public void setOperAmount(String operAmount) {
        String pre = "";
        if(this.operType.equals("0")){
            pre = "-";
        }else if (this.operType.equals("1")){
            pre = "+";
        }
        this.operAmount = pre+operAmount;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public String getOperType() {
        return operType;
    }

    public void setOperType(String operType) {

        this.operType = operType;
    }
}
